<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        var arr = [10, 20, 30]
        var arr1 = ['你好']
        //concat方法，可连接字符串，不会改变原字符串
        console.log(arr.concat(arr1));
        console.log(arr.concat(40, 50));
        console.log(arr.concat(1, [2, 3]));
        //数组不能用+连接，会变成字符串
        console.log(arr+arr1);

        var hello = ['hello', 'world'];
        //join方法，可将数组连接成字符串，不改变原数组，参数为中间间隔的值
        result = console.log(hello.join(" "));
        //reverse方法，可将数组倒置，改变原数组
        console.log(hello.reverse());
        //indexOf方法，可返回数组元素的位置
        console.log(arr.indexOf(20, 1));

        


    </script>
</body>
</html>